import request, { uploadFile } from '@/utils/request';
const base1 = 'http://58.241.230.210:9081';
const base2 = 'http://112.85.109.19:9001';

// 图片上传
export const appletUpload = (filePath) => {
  return uploadFile(`${base1}/webApis/applet/upload`, filePath, {
    name: 'file',
    formData: { fileName: '1.jpg' },
  });
};

// 上报
export const appletWtsb = (data) => {
  return request.postForm(`${base1}/webApis/applet/wtsb`, data);
};

// 上报历史数据
export const getHistoryList = (data) => {
  return request.postForm(`${base1}/webApis/applet/getHistoryList`, data);
};

// 获取事件大类
export const getFlarge = (data) => {
  return request.postForm(`${base1}/webApis/applet/getFlarge`, data);
};

// 获取事件小类
export const getFsmall = (data) => {
  return request.postForm(`${base1}/webApis/applet/getFsmall`, data);
};

export const listDecoration = (data) => {
  return request.get(`${base2}/web/api/listDecoration`, data);
};

// 获取出土列表
export const getDecoration = (data) => {
  return request.get(`${base2}/web/api/getDecoration`, data);
};

// 添加出土
export const addDecoration = (data) => {
  return request.post(`${base2}/web/api/addDecoration`, data);
};

// 查询通知公告列表
export function listNotice(data) {
  return request.get(`${base2}/business/notice/list`, data);
}

// 查询通知公告详细
export function getNotice(id) {
  return request.get(`${base2}/business/notice/${id}`);
}
